package com.ksc.storekeeper.shared.enums;

import com.google.gwt.user.client.rpc.IsSerializable;

public enum Category implements IsSerializable {

	COSMETICS("Cosmetics"), TOYS("Toys"), MISCELLANIES("Miscellanies");

	private final String value;

	private Category(String value) {
		this.value = value;
	}

	public String getValue() {
		return value;
	}

	@Override
	public String toString() {
		return this.value;
	}

	public static Category getEnum(String value) {
		if (value == null) {
			throw new IllegalArgumentException();
		}
		for (Category v : values())
			if (value.equalsIgnoreCase(v.getValue())) {
				return v;
			}
		throw new IllegalArgumentException();
	}
}
